package OOP.day09.homework.AnimalDemo03;

import java.util.Arrays;

public class RefArrayDemo02 {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[5];
        dogs[0] = new Dog("旺财", 3,"黑");
        dogs[1] = new Dog("大黄", 5,"黄");
        dogs[2] = new Dog("小黑", 2,"黑");
        dogs[3] = new Dog("小白", 1,"白");
        dogs[4] = new Dog("小黄", 4,"黄");
        Arrays.stream(dogs)
                .forEach(x -> System.out.println(x.name + "," + x.age + "岁," + x.color));
        dogs[0].eat();
        dogs[0].lookHome();
        dogs[0].swim();
        System.out.println("----------------------------");
        Chick[] chicks = new Chick[5];
        chicks[0] = new Chick("小鸡01",1,"黄");
        chicks[1] = new Chick("小鸡02",2,"绿");
        chicks[2] = new Chick("小鸡03",3,"蓝");
        chicks[3] = new Chick("小鸡04",4,"黑");
        chicks[4] = new Chick("小鸡05",5,"红");

    }
}
